'''
class Student:
    def __init__(self, new_name, new_grade):
        self.name = new_name
        self.grade = new_grade

    def display_name_and_grade(self):
        return f'The student {self.name} got a {self.grade}!'

class Course:
    def __init__(self, course_title, course_code):
        self.course_title = course_title
        self.course_code = course_code
        self.all_my_students = []

    def add_student(self, student):
        self.all_my_students.append(student)

    def display_students(self, grade):
        students_info = ""
        for student in self.all_my_students:
            students_info += student.display_name_and_grade() + "\n"
        return students_info

the_course = Course("Programming Fundamentals", "JTCS101 / DSSE101")
the_course.add_student("Lisa Simpson", 100)
the_course.display_students()
'''
class Toy:
    def __init__(self, name, color, cost):
        self.name = name
        self.color = color
        self.cost = cost

    def __str__(self):
        return f'{self.name} {self.color} ${self.cost}'

    def entertain_child(self):
        print(f"The child is having fun playing with the {self.color} {self.name}.")
'''
my_toy = Toy("car","black","20")
my_toy.entertain_child()
'''

class Toy_Box:
    def __init__(self, material):
        self.material = material
        self.toys = []

    def add_toy(self, name, color, cost):
        new_toy = Toy(name, color, cost)
        self.toys.append(new_toy)

    def display_toys(self):
        if not self.toys:
            return "No toys in the toy box."
        return "\n".join(str(toy) for toy in self.toys)

'''
toy_box = Toy_Box("Wood")
toy_box.add_toy("Barbie", "pink", 12.50)
toy_box.add_toy("train", "red", 19.99)

print(toy_box.display_toys())
'''
class Book:
    def __init__(self, title, author, price):
        self.title = title
        self.author = author
        self.price = price

    def __str__(self):
        return f"Title: {self.title}, Author: {self.author}, Price: ${self.price:.2f}"

class Bookshop:
    def __init__(self, name, location):
        self.name = name
        self.location = location
        self.books = []

    def restock_book(self, title, author, price):
        new_book = Book(title, author, price)
        self.books.append(new_book)

    def display_books(self):
        if not self.books:
            return "No books in stock."

        return "\n".join(str(book) for book in self.books)

bookshop = Bookshop("tims shop", "123 fake street")
bookshop.restock_book("good book", "someone", 55)
bookshop.restock_book("good book2", "someone", 55)
bookshop.restock_book("good book3", "someone", 55)
print(bookshop.display_books())

'''
toy_box = Toy_Box("Wood")
toy_box.add_toy("Barbie", "pink", 12.50)
toy_box.add_toy("train", "red", 19.99)
print(toy_box.display_toys())
'''
    
